import sys
from instance import instance
from numpy import array
from util import *
from perceptron import perceptron

"""
as in the algorithms the only different between the regular perceptron and the 
votedron, the way they calculate the classification. 

to use the kernel trick, one most only give the votedron a kernel function \
instead of the usual dot function.
"""

class votedron(perceptron):

    def classify(self, instance):
        sum = 0
        acc = 0
        for ins, c in zip(self.Xs, self.count):
            acc += self.dot(instance, ins)
            sum += c*sign(acc)
        return sign(sum)
    
